<template>
  <h1>{{ msg }}</h1>

  <div class="actions">
    <el-button @click="count++">count is {{ count }}</el-button>
    <el-button type="primary" @click="handleLogin">login</el-button>
  </div>
</template>

<script setup lang="ts">
  import { ref } from 'vue';
  import { login } from '@/api/modules/users';

  defineProps<{ msg: string }>();

  const count = ref(0);

  // 处理登录
  const handleLogin = async () => {
    let params = {
      username: 'zhen',
      password: '123456'
    };
    const res = await login(params);
    console.log(res, 'aaaaa login');
  };
</script>

<style scoped lang="scss">
  h1 {
    font-size: 3.2em;
    line-height: 1.1;
  }

  .actions {
    padding: 2em;
  }
</style>
